<%--
    Document   : home
    Created on : Oct 23, 2011, 5:06:42 PM
    Author     : Group 106
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" errorPage="error.jsp"%>
<%@page import="java.util.ArrayList" %>
<%@page import="java.util.List" %>
<%@page import="com.aptech.model.RealEstateType" %>
<%@page import="com.aptech.model.RealEstateStyle" %>
<%@page import="com.aptech.model.User" %>
<%@page import="com.aptech.model.realEstateInfo" %>
<%@page import="com.aptech.DAO.realEstateTypeDAO" %>
<%@page import="com.aptech.DAO.userDAO" %>
<%@page import="com.aptech.DAO.realEstateStyleDAO" %>
<%@page import="com.aptech.DAO.realEstateDAO" %>

<%@ taglib prefix="page" uri="/WEB-INF/tlds/phantrang.tld" %>
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <link rel="stylesheet" href="CSS/css.css" />
        <link rel="stylesheet" href="CSS/msh_style.css"/>
        <link rel="stylesheet" href="CSS/gallery_style.css"/>
        <!-- <link rel="stylesheet" href="CSS/css_header.css" /> -->
        <link rel="stylesheet" href="CSS/mn_left.css" />
        <link rel="stylesheet" href="CSS/acc_css.css" />
        <link rel="stylesheet" href="CSS/css_realEstateInfor.css" />
        <link rel="stylesheet" href="CSS/css_footer.css" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <%
                System.out.println("Vao trang INDEX");
                User objUser = null;
                String userID = "";
                userDAO objUserDao = null;
                if (request.getSession().getAttribute("user") != null) {
                    objUserDao = new userDAO();
                    objUser = (User) request.getSession().getAttribute("user");
                    userID = objUser.getUserID() + "";
                    User oUser = objUserDao.viewOwnProperty(Integer.parseInt(userID));
                    System.out.println("userName: " + oUser.getUserName());
                    //changPassSuccesss
    %>
    <body>

        <div id="wrap">
            <%@include file="header.jsp" %>

            <div class="clear"></div><!--End .clear-->
            <div id="main">
                <div id="left_sidebar">
                    <div id="houseType">
                        <div class="mn_header_left"></div>
                        <div class="mn_header_center">Information</div>
                        <div class="mn_header_right"></div>
                        <div class="mn_content_left"></div>
                        <div class="mn_content_center">
                            <a href="profile.jsp">Profile</a> </div>
                        <div class="mn_content_right"></div>
                        <div class="mn_content_left"></div>
                        <div class="mn_content_center">
                            <a href="cashManagement.jsp">Account</a></div>
                        <div class="mn_content_right"></div>
                        <div class="mn_content_left"></div>
                        <div class="mn_content_center">
                            <a href="changePassword.jsp">Change Password</a>
                        </div>
                        <div class="mn_content_right"></div>
                        <div class="mn_footer_left"></div>
                        <div class="mn_footer_content"></div>
                        <div class="mn_footer_right"></div>
                    </div><!--End #houseType-->
                </div><!--End #left_sidebar-->
                <div id="content">

                    <div id="account_Management">
                        <div id="acc_header_left"></div>
                        <div id="acc_header_center">Cash Management</div>
                        <div id="acc_header_right"></div>

                        <div id="acc_content_center">
                            <div class="usTitle" style="border: 1">Basic Account: </div>
                            <%
                                                int userMonney = objUserDao.getUserMoney(Integer.parseInt(userID));
                            %>
                            <div class="usValues" style="border: 1">.000 VND</div>
                            <div class="usTitle" style="border: 1">
                                <a href="payingCash.jsp">Load Card</a>
                            </div>
                            <div class="usValues" style="border: 1">
                                <a href="cashHistory.jsp?userID=<%=userID%>">History Load Card</a>
                            </div>
                        </div>

                        <div id="acc_footer_left"></div>
                        <div id="acc_footer_center"></div>
                        <div id="acc_footer_right"></div>
                    </div><!--End #account_Management-->
<!--                    <table width="600" height="200" align="center">
                        <tr>
                            <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;Basic Account: </td>

                            <td align="left"><%=userMonney%>&nbsp;&nbsp;&nbsp;&nbsp;.000 VND</td>
                        </tr>
                        <tr>
                            <td align="left">&nbsp;&nbsp;&nbsp;&nbsp;<a href="payingCash.jsp">Load Card</a></td>
                            <td align="left">&nbsp;<a href="cashHistory.jsp?userID=<%=userID%>">History Load Card</a><td>
                        </tr>
                    </table>-->
                </div><!--End #content-->
            </div><!--End #main-->
            <div class="cleaner_with_height">&nbsp;</div><!--End .clear-->
            <div id="msh_footer_panel" style="width: 942px;">
                Copyright © 2011 <a href="aptech.vn">Ha Noi - Aptech</a> | <a href="home.jsp" target="_parent">Website My Sweet Home</a> by <a href="home.jsp" target="_blank">Group 106</a>
            </div>
        </div><!--End #wrap-->
        <div class="clear"></div><!--End .clear-->
    </body>
    <%
                } else {
                    response.sendRedirect("login.jsp");
                }
    %>
</html>